import { GetProjectById, ListProjects } from "@/api/projects"; import { PrimaryButton } from "@/components/Button"; import MainLayout from "@/components/MainLayout"; import Head from "next/head"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; const ProjectDetailsPage = () => { const router = useRouter(); const { id } = router.query; const [project, setProject] = useState(); useEffect(() => { GetProjectById(id ? id.toString() : "", setProject); }, [id]); return ( Project Details | Watchman
{project?.data?.name && (

{project.data.name}

)}
router.push("/projects/" + id + "/update")} /> router.push("/projects/" + id + "/delete")} />
{project && project.data && project.data.name && ( <>
Name

{project.data.name}

ID

{project.data.id}

)}
); }; export default ProjectDetailsPage;